package com.zqh.orderud.controller;

import com.zqh.myfmmall.entity.Orders;
import com.zqh.myfmmall.result.Result;
import com.zqh.orderud.service.OrderUDService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-18 2:15
 */
@RestController
@RequestMapping("order")
public class OrderUDController{
    @Resource
    private OrderUDService orderUDService;

    @PutMapping("update")
    public Result update(@RequestBody Orders order){
        return orderUDService.updateById(order) ? Result.success() : Result.internalServerError();
    }

    @DeleteMapping("delete/{id}")
    public Result delete(@PathVariable("id") String id){
        return orderUDService.removeById(id) ? Result.success() : Result.internalServerError();
    }
}
